void solve()
{
	int n;
	cin >> n;

	ll s = 0, avg = 0;
	vector<ll> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		s += a[i];
	}
	avg = s / n;
	vector<ll> b(n, avg);

	int last = s % n, lp = n - 1;
	while (last) {
		b[lp--]++;
		last--;
	}
	for (int i = 0; i < n; i++) {
		if (a[i] > b[i]) {
			cout << "No" << '\n';
			return;
		}
		if (a[i] < b[i] && i + 1 < n) {
			ll p = b[i] - a[i];
			a[i] += p;
			a[i + 1] -= p;
		}
	}

	for (int i = 0; i < n; i++) {
		if (a[i] != b[i]) {
			cout << "No" << '\n';
			return;
		}
	}
	cout << "Yes" << '\n';
}